$(function () {
    let markId = getUrlString('markid');
    function myCardList (MyCards) {
        let data = {
            'markid':markId,
            'method':MyCards
        };
        getData('post','/niu/apiv4/niu_mycards_recordV2.php',data,function (data) {
            console.log(data);
            if (data.resultcode === '0'){
                let append = '';
                if (data.integral === null){
                    $('.myRank').html('我的积分:0')
                }else{
                    $('.myRank').html('我的积分:'+data.integral)
                }
                $(data.data).each(function (i) {
                    append += '<li>' +
                        '                <div class="rankName">' ;
                    if (i === 0){
                        append +=  '                    <img src="../../res/img/my/cardCenter/gj.png" alt="">';
                    } else if (i === 1) {
                        append +=  '                    <img src="../../res/img/my/cardCenter/yj.png" alt="">';
                    }else if (i === 2) {
                        append +=  '                    <img src="../../res/img/my/cardCenter/jj.png" alt="">';
                    }else {
                        append += i+1
                    }
                    append +=   '                </div>' +
                        '                <div class="userName">' +
                        '                    <img src="'+this.faceurl+'" alt="">' +
                        '                    <span>'+this.nick+'</span>' +
                        '                </div>' +
                        '                <div class="integral">'+this.integral+'</div>' +
                        '            </li>'
                })
                $('#convertList').append(append)
            }else {
                laymsg(data.msg)
            }
        })
    }
    myCardList('integral');
})
